package com.ruoyi.consume.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.consume.mapper.PlugConsumeMapper;
import com.ruoyi.consume.domain.PlugConsume;
import com.ruoyi.consume.service.IPlugConsumeService;

/**
 * 查看领用信息Service业务层处理
 *
 * @author ruoyi
 * @date 2021-07-23
 */
@Service
public class PlugConsumeServiceImpl implements IPlugConsumeService
{
    @Autowired
    private PlugConsumeMapper plugConsumeMapper;

    /**
     * 查询查看领用信息
     *
     * @param plugConsumeId 查看领用信息ID
     * @return 查看领用信息
     */
    @Override
    public PlugConsume selectPlugConsumeById(Long plugConsumeId)
    {
        return plugConsumeMapper.selectPlugConsumeById(plugConsumeId);
    }

    /**
     * 查询查看领用信息列表
     *
     * @param plugConsume 查看领用信息
     * @return 查看领用信息
     */
    @Override
    public List<PlugConsume> selectPlugConsumeList(PlugConsume plugConsume)
    {
        return plugConsumeMapper.selectPlugConsumeList(plugConsume);
    }

    /**
     * 新增查看领用信息
     *
     * @param plugConsume 查看领用信息
     * @return 结果
     */
    @Override
    public int insertPlugConsume(PlugConsume plugConsume)
    {
        plugConsume.setCreateTime(DateUtils.getNowDate());
        return plugConsumeMapper.insertPlugConsume(plugConsume);
    }

    /**
     * 修改查看领用信息
     *
     * @param plugConsume 查看领用信息
     * @return 结果
     */
    @Override
    public int updatePlugConsume(PlugConsume plugConsume)
    {
        plugConsume.setUpdateTime(DateUtils.getNowDate());
        return plugConsumeMapper.updatePlugConsume(plugConsume);
    }

    /**
     * 批量删除查看领用信息
     *
     * @param plugConsumeIds 需要删除的查看领用信息ID
     * @return 结果
     */
    @Override
    public int deletePlugConsumeByIds(Long[] plugConsumeIds)
    {
        return plugConsumeMapper.deletePlugConsumeByIds(plugConsumeIds);
    }

    /**
     * 删除查看领用信息信息
     *
     * @param plugConsumeId 查看领用信息ID
     * @return 结果
     */
    @Override
    public int deletePlugConsumeById(Long plugConsumeId)
    {
        return plugConsumeMapper.deletePlugConsumeById(plugConsumeId);
    }

    /**
     * 获取用户下拉框
     *
     * @param
     * @return 结果
     */
    @Override
    public List<PlugConsume> getUserName(){
        return plugConsumeMapper.getUserName();
    }
}
